<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_计算属性</title>
</head>
<body>
    <div id="app">
        <h3>姓:{{firstName}} 名:{{lastName}} </h3>
        <h4>{{splicingName()}}</h4>
        <h4>{{splicingName()}}</h4>
        <h4>{{computedName}}</h4>
        <h4>{{computedName}}</h4>
    </div>
</body>
<script src="../vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            firstName: '张',
            lastName: '三分'
        },
        methods: {
            splicingName(){
                console.log("splicingName()")
                return this.firstName + ' ' + this.lastName
            },
        },
        computed: {
            computedName(){
                console.log("computedName()")
                return this.firstName + ' ' + this.lastName
            }
        }

    })
</script>
</html>